package com.headwind.logistics.system.service.impl;

import com.headwind.logistics.common.pojo.GoodsType;
import com.headwind.logistics.system.mapper.GoodsTypeMapper;

import com.headwind.logistics.system.service.intl.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author你爸爸 Date2020/7/18 14:52
 * Version 1.0
 * DESCRIPTION
 */
@Service
public class GoodsTypeServiceImpl implements GoodsTypeService {
    @Autowired
    private GoodsTypeMapper goodsTypeMapper;
    @Override
    public List<GoodsType> selectGoodsType(Integer page, Integer rows,String goodsName) {
        if (page != null){
            page = (page-1)*rows;
        }
      return goodsTypeMapper.selectGoodsType(page,rows,goodsName);
    }

    @Override
    public int deleteGoodsType(Long goodsId) {
        return   goodsTypeMapper.deleteGoodsType(goodsId);
    }

    @Override
    public int insertGoodsType(GoodsType goodsType) {
        return goodsTypeMapper.insertGoodsType(goodsType);
    }

    @Override
    public int updateGoodsType(GoodsType goodsType) {
        return goodsTypeMapper.updateGoodsType(goodsType);
    }


}
